﻿using System;
using System.Text;
using System.IO;
using System.Collections;
using System.Collections.Generic;
namespace Tssipl.PaymentAdapter.Core
{
    public class MessageParseResults
    {
        private Object _message;
        private List<Field> _fields;
        private List<String> _errors;

        public MessageParseResults(Object Message, List<Field> Fields, List<String> Errors)
        {
            _message = Message;
            _fields = Fields;
            _errors = Errors;
        }

        /** Retrieves the message object if it exists or null
         * otherwise.
         * 
         * @return the message object or null.
         */
        public Object getMessage()
        {
            return _message;
        }


        /** Returns the number of fields in the parsed data.
         * 
         * @return the number of fields parsed.
         */
        public int fieldCount()
        {
            //HACK return _fields.size();
            return _fields.Count;
        }

        /** Retrieves the list of parsed fields for the
         * message.
         * 
         * @return a list of zero or more Field objects.
         */
        public List<Field> getFields()
        {
            return _fields;
        }


        /** Returns the number of errors in the parse.
         * 
         * @return the number of errors.
         */
        public int errorCount()
        {
            //HACK return _errors.size();
            return _errors.Count;
        }

        /** Retrieves the list of errors encountered during
         * the parsing process.
         * 
         * @return a list of errors.
         */
        public List<String> getErrors()
        {
            return _errors;
        }
    }
}